<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <style>
            #table{
                float:left;
                width:550px;
                height:370px;
                margin-left:50px;
                margin-bottom: 20px;
                margin-right:20px;
                border:1px solid #666666;
                padding:0px;
            }

            #modle{
                width:100%;
                height:30px;
                border-bottom:1px solid #666666;
            }

            #email{
                width:100%;
                height:320px;
            }

            #top{
                width:100%;
                background:url(../image/biaoti.png);
                 height:60px;
                border-bottom: 1px solid #666666;
                padding-top:5px;
                font-size:14px;
                font-family:Arial, Helvetica, sans-serif;
            }

            .buttonok{
                width:45px;
                height: 25px;
                background:url(../image/ok.png);
                float:right;
              
                border:1px outset;
                text-align: center;
                padding-top:3px;
                margin-right: 10px;
                cursor: pointer;
                font-size:14px;
                font-family:Arial, Helvetica, sans-serif;
            }
                .buttoncancel{
                width:45px;
                height: 25px;
                background:url(../image/cancel.png);
                float:right;
              
                border:1px outset;
                text-align: center;
                padding-top:3px;
                margin-right: 10px;
                cursor: pointer;
                font-size:14px;
                font-family:Arial, Helvetica, sans-serif;
            }
            .template {
                width:100px;
                height: 25px;
                background:#666666;
                float:left;
                color:#ECF5FF;
                border:1px outset;
                text-align: center;
                padding-top:3px;
                margin-left: 10px;
                cursor: pointer;
                font-size:14px;
                font-family:Arial, Helvetica, sans-serif;
            }

        </style>
        <script language="javascript">
            var click_index=0;
            var content="";

            function get_index(self,template)
            {
                click_index=self.value;
                document.getElementsByTagName('textarea')[0].value=template;
            }

            function submit()
            {
                //触发form的提交事件
                var form=document.getElementById('thisform');
                content=document.getElementById('content').value;
                form.action="config_Warning?template.content="+content+"&template.id="+click_index;
                form.submit();
                
            }

            function clear()
            {
                //触发取消事件
                document.getElementById('content').value="";
                document.getElementsByTagName('input')[0].value="";
            }
        </script>
    </head>
    <body>
        <div id="table">
            <span id="top"><b>警告邮件设置</b></span>
            <div id="modle">
                <s:iterator value="templateList" var="temp" status="index1">
                <div style="float:left;width:110px;height:38px">
                    <span class="template" value="<s:property value='#temp.id'/>" onClick="get_index(this,'<s:property value="#temp.content"/>');"><b>模板<s:property value="#index1.index"/></b></span>
                </div>
                </s:iterator>
            </div>
            <div id="email">
                <form id="thisform" action="" method="post">
                    <table cellpadding="4px" style="font-size:14px;font-family:Arial, Helvetica, sans-serif;color:#666666">
                        <tr>
                            <td width="95%" height="310px">
                                <b>内容:&nbsp</b>
                                <textarea rows="20" cols="62" id="content" name="content">

                                </textarea>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
            <div style="margin-top:0px;border-top:1px solid #666666">
                <span class="buttonok" onClick="clear();"></span>
                <span class="buttoncancel" onClick="submit();"></span>
            </div>
        </div>
    </body>
</html>